package com.kingsleo.serviceclient1.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @Description:
 * @Author: zhenglinyong
 * @CreateDate: 2024/7/23 22:20
 **/
@FeignClient(name = "service-client2", fallback = ServiceClient2Fallback.class)
public interface ServiceClient2Feign {
    @GetMapping("/hello")
    String sayHello();
}

@Component
class ServiceClient2Fallback implements ServiceClient2Feign {
    @Override
    public String sayHello() {
        return "Service Client 2 is down";
    }
}